package com.yrk.dao.impl;

import com.yrk.dao.EmpDao;
import com.yrk.entity.Emp;
import org.springframework.jdbc.core.support.JdbcDaoSupport;

import java.util.Collections;
import java.util.List;

public class EmpSupportDaoImpl extends JdbcDaoSupport implements EmpDao {

    @Override
    public List<Emp> getEmpAll() {
        return Collections.emptyList();

    }

    @Override
    public List<Emp> getEmpByName(String empName) {
        return Collections.emptyList();
    }

    @Override
    public int insertEmp(Emp emp) {
        String sql = "insert into emp (ename,job,sal) values (?,?,?)";
        Object[] params = {emp.getEname(), emp.getJob(), emp.getSal()};
        return getJdbcTemplate().update(sql, params);
    }
}
